//
//  NSString+path.m
//  仿SDWebImage
//
//  Created by WangBiao on 16/9/20.
//  Copyright © 2016年 lsrain. All rights reserved.
//

#import "NSString+path.h"

//需求：实现沙盒缓存策略
@implementation NSString (path)

- (NSString *)appendCache{
    
    //path
    NSString *path = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject;
    
    /*
     /Users/wangbiao/Library/Developer/CoreSimulator/Devices/B1A89C89-929D-4EF4-AB32-C3483F91E4AF/data/Containers/Data/Application/91CF4278-5CA8-47AE-ACAA-0BE38A145F91/Applications
     */
    
    //name
    //https://github.com/wangbiaoWB-->wangbiaoWB
    
    NSString *name = self.lastPathComponent;
    
    NSString *filePath = [path stringByAppendingPathComponent:name];
    
    return filePath;
}
@end
